Getting false positives when running script

Hello,

Occasionally I'm getting false positives when executing the attached script. Was wondering what maybe the cause in my logic. I have this script running in batchmode every 5 minutes and I typically get 2-3 e-mails a week that are false positives. Thank you.  


EHcnck - Thu Dec 17 21:21:29 EST 2015

Re: Getting false positives when running script
Mathias Mamsch - Fri Dec 18 06:24:00 EST 2015

Can you tell us what you consider a "false" positive? That would help with the analysis. Regards, Mathias

Re: Getting false positives when running script
EHcnck - Fri Dec 18 09:22:53 EST 2015

Mathias Mamsch - Fri Dec 18 06:24:00 EST 2015

Can you tell us what you consider a "false" positive? That would help with the analysis. Regards, Mathias

Folder/modules fail to match permissions settings as define within the script; but they are configured correctly.

Re: Getting false positives when running script
Mathias Mamsch - Fri Dec 18 11:14:47 EST 2015

EHcnck - Fri Dec 18 09:22:53 EST 2015

Folder/modules fail to match permissions settings as define within the script; but they are configured correctly.

Ok, do you have any other details?

I.e. is this a non reproducable thing (i.e. it happens only during batch mode, but not when run interactively) ? Does it affect Modules and Folders? Is it always different folders/modules?

-----

One possible source of failure might be, that a script changes access rights, while the report is running, even if its only for a split second.  Is it possible that some script will remove / add the permissions during the runtime of the script, even if the permissions are the same afterwards? (like an resetAccessRights script).

-----

How long does the script take to run over the whole database? Do you experience problems with the network? Is it possible that the script cannot reliably load the access records for the items and therefore fails?

-----

Do I get the logic right - you have defined "default permissions", but you want to be able to override the default permissions by the permissions inside the root folder?

With what user do you run the script? Administrator?

--------

Another thing I find strange is the "null" check in the comparison:

bool ::==(DxlObject a, DxlObject b) {
        if ( null(a) || null(b) ) return (false)
}

p = f = null and DxlO != null  will trigger the condition. For me it seems this rather should be an error.  Did you investigate why you would ever get a null DxlObject back from your function?

--------------------

 

Maybe you should "printDetails" for all the DXL Objects inside the conditions:

        if ( !null(DxlO) && !(f == DxlO) && !(p == f) ) {
                temp += rootName_(itm)
                temp += "\n"
                if ( DEBUG ) { 
                    temp += "\n**************** DEBUG INFO *************\n"
                    temp += printDetails(DxlO)
                    temp += printDetails(f)
                    temp += printDetails(p)
                    temp += "\n****************************"\n
                }
        }

This will make it easier to see why the condition failed.

I don't know if it helps, regards, Mathias